
import database
import document

class findBestMatchingSubtree():

	def __init(self, did1, did2, theta, database):
		self.base = database
		if !self.isRootNodeMatched(did1, did2):
			return
		else:
			self.base.findMatchingSiblingOrder(did1, did2);
			maxLevel = self.base.getInternalNodeMaxLevel(did1, did2)
			for curLevel in range(maxLevel, 1):
				base.findPMatchingIntNodes(did1, did2, curLevel)
				#self.maximizeSimilarityScore(did1, did2, curLevel)
				#self.deleteUnMatchingNodes(did1, did2, curLevel, theta)
			#populatingBestMatchingSubtrees(did1, did2)

	def isRootNodeMatched(self, did1, did2):
		
	def maximizeSimilarityScore(self, did1, did2, curLevel):
		#Data = self.getNon121Matching(did1, did2, curLevel)
		#for d in Data.dictresult():
		#	scoreMatrix = self.generateScoreMatrix(d)
		#	result = self.bestCombinationFinder(scoreMatrix)
		#	maxScore = result[0]
		#	maxScoreCombination = result[1]
		#	self.annotateUnusedTuple(maxScoreCombination)
		#	self.deleteUnusedTuple(maxScoreCombination)			

	def deleteUnMatchingNodes(self, did1, did2, curLevel, theta):

	def populatingBestMatchingSubtrees(self, did1, did2):

	def bestCombinationFinder(self, scoreMatrix):
	
	def getNon121Matching(self, did1, did2. curLevel):

	def generateScoreMatrix(self, data):

	def annotateUnusedTuple(self, maxScoreCombination):

	def deleteUnusedTuple(self, maxScoreCombination):	

data_base = database.database()
